package com.mdl.springmvc.ioStream.io;

import java.io.*;

/**
 * @Desc
 * @Author madengling
 * @Time 2021/1/8 16:58
 */
public class PrintTest10 {
    private static final String PATH = "G:\\dhcc\\idea\\MavenProject\\src\\main\\webapp\\files\\e\\";
    public static void main(String[] args) {
        BufferedReader br = null;
        PrintStream ps= null;
        try {
            br = new BufferedReader(new FileReader(PATH+"copy.txt"));
            ps = new PrintStream(PATH+"printcopy.txt");
            String line;
            while((line=br.readLine())!=null) {
                ps.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            ps.close();
        }

        BufferedReader br1= null;
        PrintWriter pw = null;
        try {
            br1 = new BufferedReader(new FileReader(PATH+"aa.txt"));
            pw = new PrintWriter(PATH+"printcopyaa.txt");
            String line;
            while((line=br1.readLine())!=null) {
                pw.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                br1.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            pw.close();
        }
    }
}
